package com.xyd.service;

import com.xyd.dao.AdminDao;
import com.xyd.entity.Admin;
import com.xyd.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

public class AdminService {
    SqlSession sqlSession = null;

    public Admin AdminLogin(String aname,String pwd) {
        Admin admin = new Admin();
        admin.setAname(aname);
        admin.setPwd(pwd);
        sqlSession = MybatisUtil.getSqlSession();
        try {
           return  sqlSession.getMapper(AdminDao.class).AdminLogin(admin);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            sqlSession.close();
        }
        return null;
    }

}
